
/**************************************************START OF FILE*****************************************************/




/*  ------------------------------------------------------------------------------------------------------------------
includes
*/
#include "stm32f0xx_hal.h"



/*  ------------------------------------------------------------------------------------------------------------------
Definitions
*/




/*  ------------------------------------------------------------------------------------------------------------------
Prototypes
*/




/*  ------------------------------------------------------------------------------------------------------------------
Variables
*/





/*  ------------------------------------------------------------------------------------------------------------------
Code
*/



void xBSP_KEY_Init(void)
{

	GPIO_InitTypeDef GPIO_InitStruct = {0};
	__HAL_RCC_GPIOA_CLK_ENABLE();
	HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_RESET);

	/*Configure GPIO pin : PA0 */
	GPIO_InitStruct.Pin = GPIO_PIN_4;
	GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
	GPIO_InitStruct.Pull = GPIO_PULLUP;
	GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
	HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

}



/*
*********************************************************************************************************************

@ Brief  :

@ Param  : NONE

@ Return : NONE

@ Author : YWJ

*********************************************************************************************************************
*/
extern uint8_t OffLine_HcsxxWriteFlag;
void xBSP_KEY_Scan(void)
{
	static uint32_t Count = 0;
	uint8_t Status;
	Status = HAL_GPIO_ReadPin(GPIOA , GPIO_PIN_4);

	if(Status == 0)
	{
		Count++;
		if(Count == 3)
		{
			//按键按下
			OffLine_HcsxxWriteFlag = 1;

		}
	}
	else
	{
		Count = 0;
	}
	





}




/**************************************************END OF FILE**********************************************************/
